#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
int fa[N];
int siz[N];
int gf(int x){
    if(fa[x] == x){
        return x;
    }
    return fa[x] = gf(fa[x]);
}
int f[N];
int ch[N][2];
bool rtag[N];
void rev(int x){
    rtag[x] ^= 1;
    swap(ch[x][0],ch[x][1]);
}
void push_down(int x){
    if(rtag[x]){
        rev(ch[x][0]);
        rev(ch[x][1]);
        rtag[x] = 0;
    }
}
bool is_root(int x){
    return ch[f[x]][0] != x && ch[f[x]][1] != x;
}
bool get(int x){
    return ch[f[x]][1] == x;
}
void rotate(int x){
    int y = f[x],z = f[y];
    push_down(y);
    push_down(x);
    int p = get(x);
    if(!is_root(y)){
        ch[z][get(y)] = x;
    }
    f[x] = z;
    f[y] = x;
    f[ch[x][p ^ 1]] = y;
    ch[y][p] = ch[x][p ^ 1];
    ch[x][p ^ 1] = y;
}
void splay(int x){
    while(!is_root(x)){
        int fa = f[x];
        if(!is_root(fa)){
            rotate(get(fa) == get(x)?fa:x);
        }
        rotate(x);
    }
}
int access(int x){
    int p = 0;
    while(x){
        splay(x);
        push_down(x);
        ch[x][1] = p;
        p = x;
        if(fa[f[x]] != f[x]){
            f[x] = gf(f[x]);
        }
        x = f[x];
    }
    return p;
}
void make_rot(int x){
    access(x);
    splay(x);
    rev(x);
}

int find_root(int x){
    access(x);
    splay(x);
    int p = x;
    push_down(p);
    while(ch[p][0]){
        p = ch[p][0];
        push_down(p);
    }
    splay(p);
    return p;
}
int ts = 0;
void mark(int x,int rt){
    fa[x] = rt;
    f[x] = 0;
    ts += siz[x];
    if(ch[x][0]){
        mark(ch[x][0],rt);
    }
    if(ch[x][1]){
        mark(ch[x][1],rt);
    }
    ch[x][0] = ch[x][1] = 0;
}
void add_edge(int u,int v){
    make_rot(u);
    if(find_root(v) != u){
        make_rot(u);
        f[u] = v;
        //cerr<<1<<'\n';
    }else{
        make_rot(u);
        access(v);
        splay(u);
        ts = 0;
        mark(u,u);
        siz[u] = ts;
        //cerr<<2<<'\n';
    }
}

int main(){
    int n,m,p;
    cin>>n>>m>>p;
    for(int i = 1;i<=n;i++){
        fa[i] = i;
        siz[i] = 1;
    }
    for(int i= 1;i<=m;i++){
        int u,v;
        cin>>u>>v;
        int uu = gf(u);
        int vv = gf(v);
        if(uu != vv){
            add_edge(uu,vv);
        }
    }
    for(int i = 1;i<=p;i++){
        int u,v;
        cin>>u>>v;
        int uu = gf(u);
        int vv = gf(v);
        if(uu == vv){
            cout<<siz[uu]<<'\n';
        }else{
            add_edge(uu,vv);
            uu = gf(u);
            vv = gf(v);
            if(uu == vv){
                cout<<siz[uu]<<'\n';
            }else{
                cout<<"No\n";
            }
        }
    }
}